//package cn.btks.backstagemanage.user.service.impl;
//
//import cn.btks.backstagemanage.user.pojo.User;
//import cn.btks.backstagemanage.user.repository.UserRepository;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
///**
// * @Author lijun
// * @Date 2021/1/7 11:24
// */
//@Slf4j
//@Service
//public class UserServiceImpl implements UserDetailsService {
//
//    @Autowired
//    UserRepository userRepository;
//
//    @Override
//    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
//        User user = userRepository.findByUsername(username);
//        if(user == null){
//            log.error("用户名不存在");
//            throw new UsernameNotFoundException("用户名不存在");
//        }
//        return user;
//    }
//}
